local NotificationHolder = loadstring(game:HttpGet("https://raw.githubusercontent.com/BocusLuke/UI/main/STX/Module.Lua"))() 
local Notification = loadstring(game:HttpGet("https://raw.githubusercontent.com/BocusLuke/UI/main/STX/Client.Lua"))() 
Notification:Notify( 
     {Title = "UI界面已加载", Description = "作者：思绪"}, 
     {OutlineColor = Color3.fromRGB(80, 80, 80),Time = 5, Type = "image"}, 
     {Image = "http://www.roblox.com/asset/?id=4483345998", ImageColor = Color3.fromRGB(255, 84, 84)} 
)

-- ==================== 基础变量和函数 ====================
local Players = game:GetService("Players")
local lp = Players.LocalPlayer
local mouse = lp:GetMouse()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")

-- 全局变量
local _G = {
    AutoHelpPlayer = false,
    AutoTrollPlayer = false,
    AutoDalgona = false,
    TugOfWar = false,
    DoorExit = false,
    DoorKey = false,
    HidePlayer = false,
    EspHighlight = true,
    EspGui = true,
    AutoSpeed = false,
    Speed = 50,
    InfiniteJump = false,
    Float = false,
    NoClip = false,
    AutoSkip = false,
    NoCooldownProximity = false,
    AntiLag = false,
    AntiFling = false,
    AutoMingle = false
}

local FloatConnection, NoClipConnection, CooldownProximity
local Loading = false

-- 基础函数
local function notify(Title, Text, Duration)
    game.StarterGui:SetCore("SendNotification", {
        Title = Title;
        Text = Text;
        Icon = nil;
        Duration = Duration
    })
end

local function tp(pos)
    if typeof(pos) == "CFrame" then
        lp.Character:SetPrimaryPartCFrame(pos)
    elseif typeof(pos) == "Vector3" then
        lp.Character:MoveTo(pos)
    end
end

-- Utility Functions
function CheckWall(Target)
    local Direction = (Target.Position - Workspace.CurrentCamera.Position).unit * (Target.Position - Workspace.CurrentCamera.Position).Magnitude
    local RaycastParams = RaycastParams.new()
    RaycastParams.FilterDescendantsInstances = {lp.Character, Workspace.CurrentCamera}
    RaycastParams.FilterType = Enum.RaycastFilterType.Blacklist
    local Result = Workspace:Raycast(Workspace.CurrentCamera.Position, Direction, RaycastParams)
    return Result == nil or Result.Instance:IsDescendantOf(Target)
end

function HasTool(tool)
    for _, v in pairs(lp.Character:GetChildren()) do
        if v:IsA("Tool") and v.Name == tool then
            return true
        end
    end
    for _, v in pairs(lp.Backpack:GetChildren()) do
        if v:IsA("Tool") and v.Name == tool then
            return true
        end
    end
    return false
end

function PartLagDe(g)
    for i, v in pairs(_G.PartLag or {}) do
        if g.Name:find(v) then
            g:Destroy()
        end
    end
end

-- Setup Jump and Speed
UserInputService.JumpRequest:connect(function()
    if _G.InfiniteJump == true then
        lp.Character:FindFirstChildOfClass("Humanoid"):ChangeState("Jumping")
    end
end)

lp.CharacterAdded:Connect(function(character)
    character:WaitForChild("Humanoid").WalkSpeed = _G.AutoSpeed and _G.Speed or 16
    character:WaitForChild("Humanoid"):GetPropertyChangedSignal("WalkSpeed"):Connect(function()
        if _G.AutoSpeed == true then
            character.Humanoid.WalkSpeed = _G.Speed or 50
        end
    end)
end)

-- ==================== 磁浮窗库 ====================
local library = {}
local ToggleUI = false
library.currentTab = nil
library.flags = {}

local services = setmetatable({}, {
    __index = function(t, k)
        return game.GetService(game, k)
    end
})

local mouse = services.Players.LocalPlayer:GetMouse()

function Tween(obj, t, data)
    services.TweenService:Create(obj, TweenInfo.new(t[1], Enum.EasingStyle[t[2]], Enum.EasingDirection[t[3]]), data):Play()
    return true
end

function Ripple(obj)
    spawn(function()
        if obj.ClipsDescendants ~= true then
            obj.ClipsDescendants = true
        end
        local Ripple = Instance.new("ImageLabel")
        Ripple.Name = "Ripple"
        Ripple.Parent = obj
        Ripple.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
        Ripple.BackgroundTransparency = 1.000
        Ripple.ZIndex = 8
        Ripple.Image = "rbxassetid://16785029075"
        Ripple.ImageTransparency = 0.800
        Ripple.ScaleType = Enum.ScaleType.Fit
        Ripple.ImageColor3 = Color3.fromRGB(255, 255, 255)
        Ripple.Position = UDim2.new((mouse.X - Ripple.AbsolutePosition.X) / obj.AbsoluteSize.X, 0, (mouse.Y - Ripple.AbsolutePosition.Y) / obj.AbsoluteSize.Y, 0)
        Tween(Ripple, {.3, 'Linear', 'InOut'}, {Position = UDim2.new(-5.5, 0, -5.5, 0), Size = UDim2.new(12, 0, 12, 0)})
        wait(0.15)
        Tween(Ripple, {.3, 'Linear', 'InOut'}, {ImageTransparency = 1})
        wait(.3)
        Ripple:Destroy()
    end)
end

-- # Switch Tabs # --
local switchingTabs = false
function switchTab(new)
    if switchingTabs then return end
    local old = library.currentTab
    if old == nil then
        new[2].Visible = true
        library.currentTab = new
        services.TweenService:Create(new[1], TweenInfo.new(0.1), {ImageTransparency = 0}):Play()
        services.TweenService:Create(new[1].TabText, TweenInfo.new(0.1), {TextTransparency = 0}):Play()
        return
    end

    if old[1] == new[1] then return end
    switchingTabs = true
    library.currentTab = new

    services.TweenService:Create(old[1], TweenInfo.new(0.1), {ImageTransparency = 0.2}):Play()
    services.TweenService:Create(new[1], TweenInfo.new(0.1), {ImageTransparency = 0}):Play()
    services.TweenService:Create(old[1].TabText, TweenInfo.new(0.1), {TextTransparency = 0.2}):Play()
    services.TweenService:Create(new[1].TabText, TweenInfo.new(0.1), {TextTransparency = 0}):Play()

    old[2].Visible = false
    new[2].Visible = true

    task.wait(0.1)
    switchingTabs = false
end

-- # 修复的拖动功能 # --
function drag(frame, hold)
    if not hold then
        hold = frame
    end
    
    local dragging = false
    local dragInput
    local dragStart
    local startPos

    local function update(input)
        local delta = input.Position - dragStart
        frame.Position = UDim2.new(
            startPos.X.Scale, 
            startPos.X.Offset + delta.X, 
            startPos.Y.Scale, 
            startPos.Y.Offset + delta.Y
        )
    end

    hold.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
            dragging = true
            dragStart = input.Position
            startPos = frame.Position
            
            input.Changed:Connect(function()
                if input.UserInputState == Enum.UserInputState.End then
                    dragging = false
                end
            end)
        end
    end)

    hold.InputChanged:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
            dragInput = input
        end
    end)

    services.UserInputService.InputChanged:Connect(function(input)
        if input == dragInput and dragging then
            update(input)
        end
    end)
end

function library.new(library, name, theme)
    for _, v in next, services.CoreGui:GetChildren() do
        if v.Name == "qing" then
            v:Destroy()
        end
    end
    
    if theme == 'qing' then
        MainColor = Color3.fromRGB(10, 25, 255)
        Background = Color3.fromRGB(10, 25, 255)
        zyColor = Color3.fromRGB(10, 25, 255)
        beijingColor = Color3.fromRGB(10, 25, 255)
    else
        MainColor = Color3.fromRGB(0, 51, 179)
        Background = Color3.fromRGB(0, 51, 179)
        zyColor = Color3.fromRGB(0, 51, 179)
        beijingColor = Color3.fromRGB(0, 51, 179)
    end
    
    local dogent = Instance.new("ScreenGui")
    local Main = Instance.new("Frame")
    local TabMain = Instance.new("Frame")
    local SB = Instance.new("Frame")
    local SBC = Instance.new("UICorner")
    local Side = Instance.new("Frame")
    local SideG = Instance.new("UIGradient")
    local TabBtns = Instance.new("ScrollingFrame")
    local TabBtnsL = Instance.new("UIListLayout")
    local ScriptTitle = Instance.new("TextLabel")
    local SBG = Instance.new("UIGradient")
    local Open = Instance.new("TextButton")
    local DropShadowHolder = Instance.new("Frame")
    local DropShadow = Instance.new("ImageLabel")
    local UICornerMain = Instance.new("UICorner")
    local UIGradient = Instance.new("UIGradient")
    local UIGradientTitle = Instance.new("UIGradient")

    if syn and syn.protect_gui then syn.protect_gui(dogent) end

    dogent.Name = "qing"
    dogent.Parent = services.CoreGui

    Main.Name = "Main"
    Main.Parent = dogent
    Main.AnchorPoint = Vector2.new(0.5, 0.5)
    Main.BackgroundColor3 = Background
    Main.BorderColor3 = MainColor
    Main.Position = UDim2.new(0.5, 0, 0.5, 0)
    Main.Size = UDim2.new(0, 572, 0, 353)
    Main.ZIndex = 1
    Main.Active = true
    
    -- 修复拖动：确保Main可以被拖动
    drag(Main)

    UICornerMain.Parent = Main
    UICornerMain.CornerRadius = UDim.new(0,3)

    DropShadowHolder.Name = "DropShadowHolder"
    DropShadowHolder.Parent = Main
    DropShadowHolder.BackgroundTransparency = 1.000
    DropShadowHolder.BorderSizePixel = 0
    DropShadowHolder.Size = UDim2.new(1, 0, 1, 0)
    DropShadowHolder.ZIndex = 0

    DropShadow.Name = "DropShadow"
    DropShadow.Parent = DropShadowHolder
    DropShadow.AnchorPoint = Vector2.new(0.5, 0.5)
    DropShadow.BackgroundTransparency = 1.000
    DropShadow.BorderSizePixel = 0
    DropShadow.Position = UDim2.new(0.5, 0, 0.5, 0)
    DropShadow.Size = UDim2.new(1, 43, 1, 43)
    DropShadow.ZIndex = 0
    DropShadow.Image = "rbxassetid://6015897843"
    DropShadow.ImageColor3 = Color3.fromRGB(0, 0, 0)
    DropShadow.ImageTransparency = 0.500
    DropShadow.ScaleType = Enum.ScaleType.Slice
    DropShadow.SliceCenter = Rect.new(49, 49, 450, 450)

    UIGradient.Color = ColorSequence.new{
        ColorSequenceKeypoint.new(0.00, Color3.fromRGB(255, 0, 0)), 
        ColorSequenceKeypoint.new(0.10, Color3.fromRGB(255, 127, 0)), 
        ColorSequenceKeypoint.new(0.20, Color3.fromRGB(255, 255, 0)), 
        ColorSequenceKeypoint.new(0.30, Color3.fromRGB(0, 255, 0)), 
        ColorSequenceKeypoint.new(0.40, Color3.fromRGB(0, 255, 255)), 
        ColorSequenceKeypoint.new(0.50, Color3.fromRGB(0, 0, 255)), 
        ColorSequenceKeypoint.new(0.60, Color3.fromRGB(139, 0, 255)), 
        ColorSequenceKeypoint.new(0.70, Color3.fromRGB(255, 0, 0)), 
        ColorSequenceKeypoint.new(0.80, Color3.fromRGB(255, 127, 0)), 
        ColorSequenceKeypoint.new(0.90, Color3.fromRGB(255, 255, 0)), 
        ColorSequenceKeypoint.new(1.00, Color3.fromRGB(0, 255, 0))
    }
    UIGradient.Parent = DropShadow

    local TweenService = game:GetService("TweenService")
    local tweeninfo = TweenInfo.new(7, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1)
    local tween = TweenService:Create(UIGradient, tweeninfo, {Rotation = 360})
    tween:Play()

    TabMain.Name = "TabMain"
    TabMain.Parent = Main
    TabMain.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
    TabMain.BackgroundTransparency = 1.000
    TabMain.Position = UDim2.new(0.217000037, 0, 0, 3)
    TabMain.Size = UDim2.new(0, 448, 0, 353)

    SB.Name = "SB"
    SB.Parent = Main
    SB.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
    SB.BorderColor3 = MainColor
    SB.Size = UDim2.new(0, 8, 0, 353)

    SBC.CornerRadius = UDim.new(0, 6)
    SBC.Name = "SBC"
    SBC.Parent = SB

    Side.Name = "Side"
    Side.Parent = SB
    Side.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
    Side.BorderColor3 = Color3.fromRGB(255, 255, 255)
    Side.BorderSizePixel = 0
    Side.ClipsDescendants = true
    Side.Position = UDim2.new(1, 0, 0, 0)
    Side.Size = UDim2.new(0, 110, 0, 353)

    SideG.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, zyColor), ColorSequenceKeypoint.new(1.00, zyColor)}
    SideG.Rotation = 90
    SideG.Name = "SideG"
    SideG.Parent = Side

    TabBtns.Name = "TabBtns"
    TabBtns.Parent = Side
    TabBtns.Active = true
    TabBtns.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
    TabBtns.BackgroundTransparency = 1.000
    TabBtns.BorderSizePixel = 0
    TabBtns.Position = UDim2.new(0, 0, 0.0973535776, 0)
    TabBtns.Size = UDim2.new(0, 110, 0, 318)
    TabBtns.CanvasSize = UDim2.new(0, 0, 1, 0)
    TabBtns.ScrollBarThickness = 0

    TabBtnsL.Name = "TabBtnsL"
    TabBtnsL.Parent = TabBtns
    TabBtnsL.SortOrder = Enum.SortOrder.LayoutOrder
    TabBtnsL.Padding = UDim.new(0, 12)

    ScriptTitle.Name = "ScriptTitle"
    ScriptTitle.Parent = Side
    ScriptTitle.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
    ScriptTitle.BackgroundTransparency = 1.000
    ScriptTitle.Position = UDim2.new(0, 0, 0.00953488424, 0)
    ScriptTitle.Size = UDim2.new(0, 102, 0, 20)
    ScriptTitle.Font = Enum.Font.GothamSemibold
    ScriptTitle.Text = name
    ScriptTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
    ScriptTitle.TextSize = 14.000
    ScriptTitle.TextScaled = true
    ScriptTitle.TextXAlignment = Enum.TextXAlignment.Left

    UIGradientTitle.Parent = ScriptTitle

    SBG.Color = ColorSequence.new{ColorSequenceKeypoint.new(0.00, zyColor), ColorSequenceKeypoint.new(1.00, zyColor)}
    SBG.Rotation = 90
    SBG.Name = "SBG"
    SBG.Parent = SB

    TabBtnsL:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
        TabBtns.CanvasSize = UDim2.new(0, 0, 0, TabBtnsL.AbsoluteContentSize.Y + 18)
    end)
    
    Open.Name = "Open"
    Open.Parent = dogent
    Open.BackgroundColor3 = Color3.fromRGB(25, 25, 25)
    Open.Position = UDim2.new(0.00829315186, 0, 0.31107837, 0)
    Open.Size = UDim2.new(0, 61, 0, 32)
    Open.Font = Enum.Font.SourceSans
    Open.Text = "关/开"
    Open.TextColor3 = Color3.fromRGB(255, 255, 255)
    Open.TextSize = 14.000
    Open.Active = true
    Open.Draggable = false
    Open.MouseButton1Click:Connect(function()
        Main.Visible = not Main.Visible
    end)
    
    -- 修复：Ctrl键切换显示
    services.UserInputService.InputBegan:Connect(function(input, gameProcessed)
        if gameProcessed then return end
        if input.KeyCode == Enum.KeyCode.LeftControl then
            Main.Visible = not Main.Visible
        end
    end)

    local window = {}
    
    function window.Tab(window, name, icon)
        local Tab = Instance.new("ScrollingFrame")
        local TabIco = Instance.new("ImageLabel")
        local TabText = Instance.new("TextLabel")
        local TabBtn = Instance.new("TextButton")
        local TabL = Instance.new("UIListLayout")

        Tab.Name = "Tab"
        Tab.Parent = TabMain
        Tab.Active = true
        Tab.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
        Tab.BackgroundTransparency = 1.000
        Tab.Size = UDim2.new(1, 0, 1, 0)
        Tab.ScrollBarThickness = 2
        Tab.Visible = false

        TabIco.Name = "TabIco"
        TabIco.Parent = TabBtns
        TabIco.BackgroundTransparency = 1.000
        TabIco.BorderSizePixel = 0
        TabIco.Size = UDim2.new(0, 24, 0, 24)
        TabIco.Image = ("rbxassetid://%s"):format((icon or 4370341699))
        TabIco.ImageTransparency = 0.2

        TabText.Name = "TabText"
        TabText.Parent = TabIco
        TabText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
        TabText.BackgroundTransparency = 1.000
        TabText.Position = UDim2.new(1.41666663, 0, 0, 0)
        TabText.Size = UDim2.new(0, 76, 0, 24)
        TabText.Font = Enum.Font.GothamSemibold
        TabText.Text = name
        TabText.TextColor3 = Color3.fromRGB(255, 255, 255)
        TabText.TextSize = 14.000
        TabText.TextXAlignment = Enum.TextXAlignment.Left
        TabText.TextTransparency = 0.2

        TabBtn.Name = "TabBtn"
        TabBtn.Parent = TabIco
        TabBtn.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
        TabBtn.BackgroundTransparency = 1.000
        TabBtn.BorderSizePixel = 0
        TabBtn.Size = UDim2.new(0, 110, 0, 24)
        TabBtn.AutoButtonColor = false
        TabBtn.Font = Enum.Font.SourceSans
        TabBtn.Text = ""
        TabBtn.TextColor3 = Color3.fromRGB(0, 0, 0)
        TabBtn.TextSize = 14.000

        TabL.Name = "TabL"
        TabL.Parent = Tab
        TabL.SortOrder = Enum.SortOrder.LayoutOrder
        TabL.Padding = UDim.new(0, 4)

        TabBtn.MouseButton1Click:Connect(function()
            spawn(function()
                Ripple(TabBtn)
            end)
            switchTab({TabIco, Tab})
        end)

        if library.currentTab == nil then switchTab({TabIco, Tab}) end

        TabL:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
            Tab.CanvasSize = UDim2.new(0, 0, 0, TabL.AbsoluteContentSize.Y + 8)
        end)

        local tab = {}
        
        function tab.section(tab, name, TabVal)
            local Section = Instance.new("Frame")
            local SectionC = Instance.new("UICorner")
            local SectionText = Instance.new("TextLabel")
            local SectionOpen = Instance.new("ImageLabel")
            local SectionOpened = Instance.new("ImageLabel")
            local SectionToggle = Instance.new("ImageButton")
            local Objs = Instance.new("Frame")
            local ObjsL = Instance.new("UIListLayout")

            Section.Name = "Section"
            Section.Parent = Tab
            Section.BackgroundColor3 = Color3.fromRGB(102, 190, 193)
            Section.BackgroundTransparency = 1.000
            Section.BorderSizePixel = 0
            Section.ClipsDescendants = true
            Section.Size = UDim2.new(0.981000006, 0, 0, 36)

            SectionC.CornerRadius = UDim.new(0, 6)
            SectionC.Name = "SectionC"
            SectionC.Parent = Section

            SectionText.Name = "SectionText"
            SectionText.Parent = Section
            SectionText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
            SectionText.BackgroundTransparency = 1.000
            SectionText.Position = UDim2.new(0.0887396261, 0, 0, 0)
            SectionText.Size = UDim2.new(0, 401, 0, 36)
            SectionText.Font = Enum.Font.GothamSemibold
            SectionText.Text = name
            SectionText.TextColor3 = Color3.fromRGB(255, 255, 255)
            SectionText.TextSize = 16.000
            SectionText.TextXAlignment = Enum.TextXAlignment.Left

            SectionOpen.Name = "SectionOpen"
            SectionOpen.Parent = SectionText
            SectionOpen.BackgroundTransparency = 1
            SectionOpen.BorderSizePixel = 0
            SectionOpen.Position = UDim2.new(0, -33, 0, 5)
            SectionOpen.Size = UDim2.new(0, 26, 0, 26)
            SectionOpen.Image = "http://www.roblox.com/asset/?id=6031302934"

            SectionOpened.Name = "SectionOpened"
            SectionOpened.Parent = SectionOpen
            SectionOpened.BackgroundTransparency = 1.000
            SectionOpened.BorderSizePixel = 0
            SectionOpened.Size = UDim2.new(0, 26, 0, 26)
            SectionOpened.Image = "http://www.roblox.com/asset/?id=6031302932"
            SectionOpened.ImageTransparency = 1.000

            SectionToggle.Name = "SectionToggle"
            SectionToggle.Parent = SectionOpen
            SectionToggle.BackgroundTransparency = 1
            SectionToggle.BorderSizePixel = 0
            SectionToggle.Size = UDim2.new(0, 26, 0, 26)

            Objs.Name = "Objs"
            Objs.Parent = Section
            Objs.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
            Objs.BackgroundTransparency = 1
            Objs.BorderSizePixel = 0
            Objs.Position = UDim2.new(0, 6, 0, 36)
            Objs.Size = UDim2.new(0.986347735, 0, 0, 0)

            ObjsL.Name = "ObjsL"
            ObjsL.Parent = Objs
            ObjsL.SortOrder = Enum.SortOrder.LayoutOrder
            ObjsL.Padding = UDim.new(0, 8)

            local open = TabVal
            if TabVal ~= false then
                Section.Size = UDim2.new(0.981000006, 0, 0, open and 36 + ObjsL.AbsoluteContentSize.Y + 8 or 36)
                SectionOpened.ImageTransparency = (open and 0 or 1)
                SectionOpen.ImageTransparency = (open and 1 or 0)
            end

            SectionToggle.MouseButton1Click:Connect(function()
                open = not open
                Section.Size = UDim2.new(0.981000006, 0, 0, open and 36 + ObjsL.AbsoluteContentSize.Y + 8 or 36)
                SectionOpened.ImageTransparency = (open and 0 or 1)
                SectionOpen.ImageTransparency = (open and 1 or 0)
            end)

            ObjsL:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
                if not open then return end
                Section.Size = UDim2.new(0.981000006, 0, 0, 36 + ObjsL.AbsoluteContentSize.Y + 8)
            end)

            local section = {}
            
            function section.Button(section, text, callback)
                local callback = callback or function() end

                local BtnModule = Instance.new("Frame")
                local Btn = Instance.new("TextButton")
                local BtnC = Instance.new("UICorner")

                BtnModule.Name = "BtnModule"
                BtnModule.Parent = Objs
                BtnModule.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
                BtnModule.BackgroundTransparency = 1.000
                BtnModule.BorderSizePixel = 0
                BtnModule.Position = UDim2.new(0, 0, 0, 0)
                BtnModule.Size = UDim2.new(0, 428, 0, 38)

                Btn.Name = "Btn"
                Btn.Parent = BtnModule
                Btn.BackgroundColor3 = zyColor
                Btn.BorderSizePixel = 0
                Btn.Size = UDim2.new(0, 428, 0, 38)
                Btn.AutoButtonColor = false
                Btn.Font = Enum.Font.GothamSemibold
                Btn.Text = "   " .. text
                Btn.TextColor3 = Color3.fromRGB(255, 255, 255)
                Btn.TextSize = 16.000
                Btn.TextXAlignment = Enum.TextXAlignment.Left

                BtnC.CornerRadius = UDim.new(0, 6)
                BtnC.Name = "BtnC"
                BtnC.Parent = Btn

                Btn.MouseButton1Click:Connect(function()
                    spawn(function()
                        Ripple(Btn)
                    end)
                    spawn(callback)
                end)
            end

            function section:Label(text)
                local LabelModule = Instance.new("Frame")
                local TextLabel = Instance.new("TextLabel")
                local LabelC = Instance.new("UICorner")

                LabelModule.Name = "LabelModule"
                LabelModule.Parent = Objs
                LabelModule.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
                LabelModule.BackgroundTransparency = 1.000
                LabelModule.BorderSizePixel = 0
                LabelModule.Position = UDim2.new(0, 0, 0, 0)
                LabelModule.Size = UDim2.new(0, 428, 0, 19)

                TextLabel.Parent = LabelModule
                TextLabel.BackgroundColor3 = zyColor
                TextLabel.Size = UDim2.new(0, 428, 0, 22)
                TextLabel.Font = Enum.Font.GothamSemibold
                TextLabel.Text = text
                TextLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
                TextLabel.TextSize = 14.000

                LabelC.CornerRadius = UDim.new(0, 6)
                LabelC.Name = "LabelC"
                LabelC.Parent = TextLabel
                return TextLabel
            end

            function section.Toggle(section, text, flag, enabled, callback)
                local callback = callback or function() end
                local enabled = enabled or false
                assert(text, "No text provided")
                assert(flag, "No flag provided")

                library.flags[flag] = enabled

                local ToggleModule = Instance.new("Frame")
                local ToggleBtn = Instance.new("TextButton")
                local ToggleBtnC = Instance.new("UICorner")
                local ToggleDisable = Instance.new("Frame")
                local ToggleSwitch = Instance.new("Frame")
                local ToggleSwitchC = Instance.new("UICorner")
                local ToggleDisableC = Instance.new("UICorner")

                ToggleModule.Name = "ToggleModule"
                ToggleModule.Parent = Objs
                ToggleModule.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
                ToggleModule.BackgroundTransparency = 1.000
                ToggleModule.BorderSizePixel = 0
                ToggleModule.Position = UDim2.new(0, 0, 0, 0)
                ToggleModule.Size = UDim2.new(0, 428, 0, 38)

                ToggleBtn.Name = "ToggleBtn"
                ToggleBtn.Parent = ToggleModule
                ToggleBtn.BackgroundColor3 = zyColor
                ToggleBtn.BorderSizePixel = 0
                ToggleBtn.Size = UDim2.new(0, 428, 0, 38)
                ToggleBtn.AutoButtonColor = false
                ToggleBtn.Font = Enum.Font.GothamSemibold
                ToggleBtn.Text = "   " .. text
                ToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255)
                ToggleBtn.TextSize = 16.000
                ToggleBtn.TextXAlignment = Enum.TextXAlignment.Left

                ToggleBtnC.CornerRadius = UDim.new(0, 6)
                ToggleBtnC.Name = "ToggleBtnC"
                ToggleBtnC.Parent = ToggleBtn

                ToggleDisable.Name = "ToggleDisable"
                ToggleDisable.Parent = ToggleBtn
                ToggleDisable.BackgroundColor3 = Background
                ToggleDisable.BorderSizePixel = 0
                ToggleDisable.Position = UDim2.new(0.901869178, 0, 0.208881587, 0)
                ToggleDisable.Size = UDim2.new(0, 36, 0, 22)

                ToggleSwitch.Name = "ToggleSwitch"
                ToggleSwitch.Parent = ToggleDisable
                ToggleSwitch.BackgroundColor3 = beijingColor
                ToggleSwitch.Size = UDim2.new(0, 24, 0, 22)

                ToggleSwitchC.CornerRadius = UDim.new(0, 6)
                ToggleSwitchC.Name = "ToggleSwitchC"
                ToggleSwitchC.Parent = ToggleSwitch

                ToggleDisableC.CornerRadius = UDim.new(0, 6)
                ToggleDisableC.Name = "ToggleDisableC"
                ToggleDisableC.Parent = ToggleDisable

                local funcs = {
                    SetState = function(self, state)
                        if state == nil then state = not library.flags[flag] end
                        if library.flags[flag] == state then return end
                        services.TweenService:Create(ToggleSwitch, TweenInfo.new(0.2), {Position = UDim2.new(0, (state and ToggleSwitch.Size.X.Offset / 2 or 0), 0, 0), BackgroundColor3 = (state and Color3.fromRGB(255, 255, 255) or beijingColor)}):Play()
                        library.flags[flag] = state
                        callback(state)
                    end,
                    Module = ToggleModule
                }

                if enabled ~= false then
                    funcs:SetState(flag,true)
                end

                ToggleBtn.MouseButton1Click:Connect(function()
                    funcs:SetState()
                end)
                return funcs
            end

            function section.Textbox(section, text, flag, default, callback)
                local callback = callback or function() end
                assert(text, "No text provided")
                assert(flag, "No flag provided")
                assert(default, "No default text provided")

                library.flags[flag] = default

                local TextboxModule = Instance.new("Frame")
                local TextboxBack = Instance.new("TextButton")
                local TextboxBackC = Instance.new("UICorner")
                local BoxBG = Instance.new("TextButton")
                local BoxBGC = Instance.new("UICorner")
                local TextBox = Instance.new("TextBox")
                local TextboxBackL = Instance.new("UIListLayout")
                local TextboxBackP = Instance.new("UIPadding")

                TextboxModule.Name = "TextboxModule"
                TextboxModule.Parent = Objs
                TextboxModule.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
                TextboxModule.BackgroundTransparency = 1.000
                TextboxModule.BorderSizePixel = 0
                TextboxModule.Position = UDim2.new(0, 0, 0, 0)
                TextboxModule.Size = UDim2.new(0, 428, 0, 38)

                TextboxBack.Name = "TextboxBack"
                TextboxBack.Parent = TextboxModule
                TextboxBack.BackgroundColor3 = zyColor
                TextboxBack.BorderSizePixel = 0
                TextboxBack.Size = UDim2.new(0, 428, 0, 38)
                TextboxBack.AutoButtonColor = false
                TextboxBack.Font = Enum.Font.GothamSemibold
                TextboxBack.Text = "   " .. text
                TextboxBack.TextColor3 = Color3.fromRGB(255, 255, 255)
                TextboxBack.TextSize = 16.000
                TextboxBack.TextXAlignment = Enum.TextXAlignment.Left

                TextboxBackC.CornerRadius = UDim.new(0, 6)
                TextboxBackC.Name = "TextboxBackC"
                TextboxBackC.Parent = TextboxBack

                BoxBG.Name = "BoxBG"
                BoxBG.Parent = TextboxBack
                BoxBG.BackgroundColor3 = Background
                BoxBG.BorderSizePixel = 0
                BoxBG.Position = UDim2.new(0.763033211, 0, 0.289473683, 0)
                BoxBG.Size = UDim2.new(0, 100, 0, 28)
                BoxBG.AutoButtonColor = false
                BoxBG.Font = Enum.Font.Gotham
                BoxBG.Text = ""
                BoxBG.TextColor3 = Color3.fromRGB(255, 255, 255)
                BoxBG.TextSize = 14.000

                BoxBGC.CornerRadius = UDim.new(0, 6)
                BoxBGC.Name = "BoxBGC"
                BoxBGC.Parent = BoxBG

                TextBox.Parent = BoxBG
                TextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
                TextBox.BackgroundTransparency = 1.000
                TextBox.BorderSizePixel = 0
                TextBox.Size = UDim2.new(1, 0, 1, 0)
                TextBox.Font = Enum.Font.Gotham
                TextBox.Text = default
                TextBox.TextColor3 = Color3.fromRGB(255, 255, 255)
                TextBox.TextSize = 14.000

                TextboxBackL.Name = "TextboxBackL"
                TextboxBackL.Parent = TextboxBack
                TextboxBackL.HorizontalAlignment = Enum.HorizontalAlignment.Right
                TextboxBackL.SortOrder = Enum.SortOrder.LayoutOrder
                TextboxBackL.VerticalAlignment = Enum.VerticalAlignment.Center

                TextboxBackP.Name = "TextboxBackP"
                TextboxBackP.Parent = TextboxBack
                TextboxBackP.PaddingRight = UDim.new(0, 6)

                TextBox.FocusLost:Connect(function()
                    if TextBox.Text == "" then
                        TextBox.Text = default
                    end
                    library.flags[flag] = TextBox.Text
                    callback(TextBox.Text)
                end)

                TextBox:GetPropertyChangedSignal("TextBounds"):Connect(function()
                    BoxBG.Size = UDim2.new(0, TextBox.TextBounds.X + 30, 0, 28)
                end)
                BoxBG.Size = UDim2.new(0, TextBox.TextBounds.X + 30, 0, 28)
            end

            function section.Dropdown(section, text, flag, options, callback)
                local callback = callback or function() end
                local options = options or {}
                assert(text, "No text provided")
                assert(flag, "No flag provided")

                library.flags[flag] = nil

                local DropdownModule = Instance.new("Frame")
                local DropdownTop = Instance.new("TextButton")
                local DropdownTopC = Instance.new("UICorner")
                local DropdownOpen = Instance.new("TextButton")
                local DropdownText = Instance.new("TextBox")
                local DropdownModuleL = Instance.new("UIListLayout")

                DropdownModule.Name = "DropdownModule"
                DropdownModule.Parent = Objs
                DropdownModule.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
                DropdownModule.BackgroundTransparency = 1.000
                DropdownModule.BorderSizePixel = 0
                DropdownModule.ClipsDescendants = true
                DropdownModule.Position = UDim2.new(0, 0, 0, 0)
                DropdownModule.Size = UDim2.new(0, 428, 0, 38)

                DropdownTop.Name = "DropdownTop"
                DropdownTop.Parent = DropdownModule
                DropdownTop.BackgroundColor3 = zyColor
                DropdownTop.BorderSizePixel = 0
                DropdownTop.Size = UDim2.new(0, 428, 0, 38)
                DropdownTop.AutoButtonColor = false
                DropdownTop.Font = Enum.Font.GothamSemibold
                DropdownTop.Text = ""
                DropdownTop.TextColor3 = Color3.fromRGB(255, 255, 255)
                DropdownTop.TextSize = 16.000
                DropdownTop.TextXAlignment = Enum.TextXAlignment.Left

                DropdownTopC.CornerRadius = UDim.new(0, 6)
                DropdownTopC.Name = "DropdownTopC"
                DropdownTopC.Parent = DropdownTop

                DropdownOpen.Name = "DropdownOpen"
                DropdownOpen.Parent = DropdownTop
                DropdownOpen.AnchorPoint = Vector2.new(0, 0.5)
                DropdownOpen.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
                DropdownOpen.BackgroundTransparency = 1.000
                DropdownOpen.BorderSizePixel = 0
                DropdownOpen.Position = UDim2.new(0.918383181, 0, 0.5, 0)
                DropdownOpen.Size = UDim2.new(0, 20, 0, 20)
                DropdownOpen.Font = Enum.Font.Gotham
                DropdownOpen.Text = "+"
                DropdownOpen.TextColor3 = Color3.fromRGB(255, 255, 255)
                DropdownOpen.TextSize = 24.000
                DropdownOpen.TextWrapped = true

                DropdownText.Name = "DropdownText"
                DropdownText.Parent = DropdownTop
                DropdownText.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
                DropdownText.BackgroundTransparency = 1.000
                DropdownText.BorderSizePixel = 0
                DropdownText.Position = UDim2.new(0.0373831764, 0, 0, 0)
                DropdownText.Size = UDim2.new(0, 184, 0, 38)
                DropdownText.Font = Enum.Font.GothamSemibold
                DropdownText.PlaceholderColor3 = Color3.fromRGB(255, 255, 255)
                DropdownText.PlaceholderText = text
                DropdownText.Text = ""
                DropdownText.TextColor3 = Color3.fromRGB(255, 255, 255)
                DropdownText.TextSize = 16.000
                DropdownText.TextXAlignment = Enum.TextXAlignment.Left

                DropdownModuleL.Name = "DropdownModuleL"
                DropdownModuleL.Parent = DropdownModule
                DropdownModuleL.SortOrder = Enum.SortOrder.LayoutOrder
                DropdownModuleL.Padding = UDim.new(0, 4)

                local funcs = {}
                funcs.AddOption = function(self, option)
                    local Option = Instance.new("TextButton")
                    local OptionC = Instance.new("UICorner")

                    Option.Name = "Option_" .. option
                    Option.Parent = DropdownModule
                    Option.BackgroundColor3 = zyColor
                    Option.BorderSizePixel = 0
                    Option.Position = UDim2.new(0, 0, 0.328125, 0)
                    Option.Size = UDim2.new(0, 428, 0, 26)
                    Option.AutoButtonColor = false
                    Option.Font = Enum.Font.Gotham
                    Option.Text = option
                    Option.TextColor3 = Color3.fromRGB(255, 255, 255)
                    Option.TextSize = 14.000

                    OptionC.CornerRadius = UDim.new(0, 6)
                    OptionC.Name = "OptionC"
                    OptionC.Parent = Option

                    Option.MouseButton1Click:Connect(function()
                        callback(Option.Text)
                        DropdownText.Text = Option.Text
                        library.flags[flag] = Option.Text
                    end)
                end

                funcs.SetOptions = function(self, options)
                    for _, v in next, DropdownModule:GetChildren() do
                        if v.Name:match("Option_") then
                            v:Destroy()
                        end
                    end
                    for _,v in next, options do
                        funcs:AddOption(v)
                    end
                end

                funcs:SetOptions(options)
                return funcs
            end

            return section
        end
        return tab
    end
    return window
end

-- ==================== 创建界面和所有功能 ====================
local win = library:new("思绪脚本中心-付费版")

-- 创建4个主要标签页
local Tab1 = win:Tab("主线关卡", "10882439086")
local Tab2 = win:Tab("躲猫猫", "10728953248")
local Tab3 = win:Tab("杂项", "4626047596")
local Tab4 = win:Tab("小游戏", "4483345998")

-- ==================== 标签1: 主线关卡 ====================
local SectionMain1 = Tab1:section("红绿灯")
local SectionMain2 = Tab1:section("抠糖饼 & 拔河")

-- 红绿灯功能
SectionMain1:Button("一键到终点", function()
    if Workspace:FindFirstChild("RedLightGreenLight") and Workspace.RedLightGreenLight:FindFirstChild("sand") and Workspace.RedLightGreenLight.sand:FindFirstChild("crossedover") then
        local pos = Workspace.RedLightGreenLight.sand.crossedover.Position + Vector3.new(0, 5, 0)
        lp.Character.HumanoidRootPart.CFrame = CFrame.new(pos, pos + Vector3.new(0, 0, -1))
        notify("传送成功", "已抵达终点！", 3)
    end
end)

SectionMain1:Button("帮助玩家", function()
    if Loading then return end
    Loading = true
    for _, v in pairs(game.Players:GetPlayers()) do
        if v.Character:FindFirstChild("HumanoidRootPart") and v.Character.HumanoidRootPart:FindFirstChild("CarryPrompt") and v.Character.HumanoidRootPart.CarryPrompt.Enabled == true then
            if v.Character:FindFirstChild("SafeRedLightGreenLight") == nil then
                lp.Character.HumanoidRootPart.CFrame = v.Character.HumanoidRootPart.CFrame
                wait(0.3)
                repeat task.wait(0.1)
                    fireproximityprompt(v.Character.HumanoidRootPart:FindFirstChild("CarryPrompt"))
                until v.Character.HumanoidRootPart.CarryPrompt.Enabled == false
                wait(0.5)
                if Workspace:FindFirstChild("RedLightGreenLight") and Workspace.RedLightGreenLight:FindFirstChild("sand") and Workspace.RedLightGreenLight.sand:FindFirstChild("crossedover") then
                    local pos = Workspace.RedLightGreenLight.sand.crossedover.Position + Vector3.new(0, 5, 0)
                    lp.Character.HumanoidRootPart.CFrame = CFrame.new(pos, pos + Vector3.new(0, 0, -1))
                end
                wait(0.4)
                ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("ClickedButton"):FireServer({tryingtoleave = true})
                break
            end
        end
    end
    Loading = false
end)

SectionMain1:Toggle("自动帮助玩家", "autoHelpPlayer", false, function(state)
    _G.AutoHelpPlayer = state
    while _G.AutoHelpPlayer do
        pcall(function()
            for _, v in pairs(game.Players:GetPlayers()) do
                if v ~= lp and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
                    local carryPrompt = v.Character.HumanoidRootPart:FindFirstChild("CarryPrompt")
                    if carryPrompt and carryPrompt.Enabled and not v.Character:FindFirstChild("SafeRedLightGreenLight") then
                        lp.Character.HumanoidRootPart.CFrame = v.Character.HumanoidRootPart.CFrame
                        wait(0.3)
                        repeat
                            fireproximityprompt(carryPrompt)
                            task.wait(0.1)
                        until not carryPrompt.Enabled or not carryPrompt.Parent
                        wait(0.5)
                        if Workspace:FindFirstChild("RedLightGreenLight") and Workspace.RedLightGreenLight:FindFirstChild("sand") and Workspace.RedLightGreenLight.sand:FindFirstChild("crossedover") then
                            local pos = Workspace.RedLightGreenLight.sand.crossedover.Position + Vector3.new(0, 5, 0)
                            lp.Character.HumanoidRootPart.CFrame = CFrame.new(pos, pos + Vector3.new(0, 0, -1))
                        end
                        wait(0.4)
                        ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("ClickedButton"):FireServer({tryingtoleave = true})
                        break
                    end
                end
            end
        end)
        task.wait(2)
    end
end)

SectionMain1:Toggle("自动恶搞玩家", "autoTrollPlayer", false, function(state)
    _G.AutoTrollPlayer = state
    while _G.AutoTrollPlayer do
        pcall(function()
            for _, v in pairs(game.Players:GetPlayers()) do
                if v.Character:FindFirstChild("HumanoidRootPart") and v.Character.HumanoidRootPart:FindFirstChild("CarryPrompt") and v.Character.HumanoidRootPart.CarryPrompt.Enabled == true then
                    if v.Character:FindFirstChild("SafeRedLightGreenLight") == nil then
                        lp.Character.HumanoidRootPart.CFrame = v.Character.HumanoidRootPart.CFrame
                        wait(0.3)
                        repeat task.wait(0.1)
                            fireproximityprompt(v.Character.HumanoidRootPart:FindFirstChild("CarryPrompt"))
                        until v.Character.HumanoidRootPart.CarryPrompt.Enabled == false
                        wait(0.5)
                        if Workspace:FindFirstChild("RedLightGreenLight") then
                            lp.Character.HumanoidRootPart.CFrame = CFrame.new(-84, 1023, -537)
                        end
                        wait(0.4)
                        ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("ClickedButton"):FireServer({tryingtoleave = true})
                        break
                    end
                end
            end
        end)
        task.wait()
    end
end)

-- 抠糖饼 & 拔河功能
SectionMain2:Button("一键完成扣糖饼", function()
    pcall(function()
        if ReplicatedStorage:FindFirstChild("Modules") and ReplicatedStorage.Modules:FindFirstChild("Games") then
            local DalgonaClientModule = ReplicatedStorage.Modules.Games:FindFirstChild("DalgonaClient")
            if DalgonaClientModule then
                for i, v in pairs(getreg()) do
                    if typeof(v) == "function" and islclosure(v) then
                        if getfenv(v).script == DalgonaClientModule then
                            if getinfo(v).nups == 73 then
                                setupvalue(v, 31, 9e9)
                                notify("椪糖完成", "抠图已完成！", 3)
                            end
                        end
                    end
                end
            end
        end
    end)
end)

SectionMain2:Toggle("自动扣糖饼", "autoDalgona", false, function(state)
    _G.AutoDalgona = state
    while _G.AutoDalgona do
        pcall(function()
            if ReplicatedStorage:FindFirstChild("Modules") and ReplicatedStorage.Modules:FindFirstChild("Games") then
                local DalgonaClientModule = ReplicatedStorage.Modules.Games:FindFirstChild("DalgonaClient")
                if DalgonaClientModule then
                    for i, v in pairs(getreg()) do
                        if typeof(v) == "function" and islclosure(v) then
                            if getfenv(v).script == DalgonaClientModule then
                                if getinfo(v).nups == 73 then
                                    setupvalue(v, 31, 9e9)
                                end
                            end
                        end
                    end
                end
            end
        end)
        task.wait(5)
    end
end)

SectionMain2:Toggle("自动拔河", "autoTugOfWar", false, function(state)
    _G.TugOfWar = state
    while _G.TugOfWar do
        pcall(function()
            ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("TemporaryReachedBindable"):FireServer({GameQTE = true})
        end)
        task.wait(0.1)
    end
end)

-- ==================== 标签2: 躲猫猫 ====================
local SectionHide1 = Tab2:section("透视功能")
local SectionHide2 = Tab2:section("传送收集")

-- 透视功能
SectionHide1:Toggle("出口透视", "doorExitEsp", false, function(state)
    _G.DoorExit = state
    if state then
        task.spawn(function()
            while _G.DoorExit do
                pcall(function()
                    if Workspace:FindFirstChild("HideAndSeekMap") then
                        for i, v in pairs(Workspace:FindFirstChild("HideAndSeekMap"):GetChildren()) do
                            if v.Name == "NEWFIXEDDOORS" then
                                for k, m in pairs(v:GetChildren()) do
                                    if m.Name:find("Floor") and m:FindFirstChild("EXITDOORS") then
                                        for _, a in pairs(m:FindFirstChild("EXITDOORS"):GetChildren()) do
                                            if a:IsA("Model") and a:FindFirstChild("DoorRoot") then
                                                -- Clean existing ESP
                                                for _, z in pairs(a.DoorRoot:GetChildren()) do
                                                    if z.Name:find("Esp_") then
                                                        z:Destroy()
                                                    end
                                                end

                                                -- Add highlight
                                                if not a.DoorRoot:FindFirstChild("Esp_Highlight") then
                                                    local Highlight = Instance.new("Highlight")
                                                    Highlight.Name = "Esp_Highlight"
                                                    Highlight.FillColor = Color3.fromRGB(0, 255, 0)
                                                    Highlight.OutlineColor = Color3.fromRGB(0, 255, 0)
                                                    Highlight.FillTransparency = 0.5
                                                    Highlight.OutlineTransparency = 0
                                                    Highlight.Adornee = a
                                                    Highlight.Parent = a.DoorRoot
                                                end

                                                -- Add GUI ESP
                                                if not a.DoorRoot:FindFirstChild("Esp_Gui") then
                                                    local BillboardGui = Instance.new("BillboardGui")
                                                    BillboardGui.Name = "Esp_Gui"
                                                    BillboardGui.Size = UDim2.new(0, 200, 0, 50)
                                                    BillboardGui.StudsOffset = Vector3.new(0, 3, 0)
                                                    BillboardGui.AlwaysOnTop = true
                                                    BillboardGui.Parent = a.DoorRoot

                                                    local TextLabel = Instance.new("TextLabel")
                                                    TextLabel.Size = UDim2.new(1, 0, 1, 0)
                                                    TextLabel.BackgroundTransparency = 1
                                                    TextLabel.Text = "出口大门"
                                                    TextLabel.TextColor3 = Color3.fromRGB(0, 255, 0)
                                                    TextLabel.TextScaled = true
                                                    TextLabel.Font = Enum.Font.SourceSansBold
                                                    TextLabel.Parent = BillboardGui

                                                    local UIStroke = Instance.new("UIStroke")
                                                    UIStroke.Color = Color3.new(0, 0, 0)
                                                    UIStroke.Thickness = 1.5
                                                    UIStroke.Parent = TextLabel
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end)
                task.wait(1)
            end
        end)
    else
        -- Clean up all door ESP when disabled
        if Workspace:FindFirstChild("HideAndSeekMap") then
            for i, v in pairs(Workspace:FindFirstChild("HideAndSeekMap"):GetChildren()) do
                if v.Name == "NEWFIXEDDOORS" then
                    for k, m in pairs(v:GetChildren()) do
                        if m.Name:find("Floor") and m:FindFirstChild("EXITDOORS") then
                            for _, a in pairs(m:FindFirstChild("EXITDOORS"):GetChildren()) do
                                if a:IsA("Model") and a:FindFirstChild("DoorRoot") then
                                    for _, z in pairs(a.DoorRoot:GetChildren()) do
                                        if z.Name:find("Esp_") then
                                            z:Destroy()
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
end)

SectionHide1:Toggle("钥匙透视", "keyEsp", false, function(state)
    _G.DoorKey = state
    if state then
        task.spawn(function()
            while _G.DoorKey do
                pcall(function()
                    for _, a in pairs(Workspace.Effects:GetChildren()) do
                        if a.Name:find("DroppedKey") and a:FindFirstChild("Handle") then
                            -- Clean existing ESP
                            for _, z in pairs(a.Handle:GetChildren()) do
                                if z.Name:find("Esp_") then
                                    z:Destroy()
                                end
                            end

                            if not a.Handle:FindFirstChild("Esp_Highlight") then
                                local Highlight = Instance.new("Highlight")
                                Highlight.Name = "Esp_Highlight"
                                Highlight.FillColor = Color3.fromRGB(255, 255, 0)
                                Highlight.OutlineColor = Color3.fromRGB(255, 255, 0)
                                Highlight.FillTransparency = 0.3
                                Highlight.OutlineTransparency = 0
                                Highlight.Adornee = a
                                Highlight.Parent = a.Handle
                            end

                            if not a.Handle:FindFirstChild("Esp_Gui") then
                                local BillboardGui = Instance.new("BillboardGui")
                                BillboardGui.Name = "Esp_Gui"
                                BillboardGui.Size = UDim2.new(0, 150, 0, 40)
                                BillboardGui.StudsOffset = Vector3.new(0, 3, 0)
                                BillboardGui.AlwaysOnTop = true
                                BillboardGui.Parent = a.Handle

                                local TextLabel = Instance.new("TextLabel")
                                TextLabel.Size = UDim2.new(1, 0, 1, 0)
                                TextLabel.BackgroundTransparency = 1
                                TextLabel.Text = "钥匙"
                                TextLabel.TextColor3 = Color3.fromRGB(255, 255, 0)
                                TextLabel.TextScaled = true
                                TextLabel.Font = Enum.Font.SourceSansBold
                                TextLabel.Parent = BillboardGui

                                local UIStroke = Instance.new("UIStroke")
                                UIStroke.Color = Color3.new(0, 0, 0)
                                UIStroke.Thickness = 1.5
                                UIStroke.Parent = TextLabel
                            end
                        end
                    end
                end)
                task.wait(1)
            end
        end)
    else
        -- Clean up all key ESP when disabled
        for _, a in pairs(Workspace.Effects:GetChildren()) do
            if a.Name:find("DroppedKey") and a:FindFirstChild("Handle") then
                for _, z in pairs(a.Handle:GetChildren()) do
                    if z.Name:find("Esp_") then
                        z:Destroy()
                    end
                end
            end
        end
    end
end)

SectionHide1:Toggle("躲藏玩家透视", "hidePlayerEsp", false, function(state)
    _G.HidePlayer = state
    if state then
        task.spawn(function()
            while _G.HidePlayer do
                pcall(function()
                    for i, v in pairs(game.Players:GetChildren()) do
                        if v ~= lp and v.Character and v.Character:FindFirstChild("Head") and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Humanoid") then
                            if v:GetAttribute("IsHider") then
                                -- Clean existing ESP first
                                for _, z in pairs(v.Character.Head:GetChildren()) do
                                    if z.Name:find("Esp_") then
                                        z:Destroy()
                                    end
                                end

                                if not v.Character.Head:FindFirstChild("Esp_Highlight") then
                                    local Highlight = Instance.new("Highlight")
                                    Highlight.Name = "Esp_Highlight"
                                    Highlight.FillColor = Color3.fromRGB(255, 0, 0)
                                    Highlight.OutlineColor = Color3.fromRGB(255, 0, 0)
                                    Highlight.FillTransparency = 0.5
                                    Highlight.OutlineTransparency = 0
                                    Highlight.Adornee = v.Character
                                    Highlight.Parent = v.Character.Head
                                end

                                if not v.Character.Head:FindFirstChild("Esp_Gui") then
                                    local BillboardGui = Instance.new("BillboardGui")
                                    BillboardGui.Name = "Esp_Gui"
                                    BillboardGui.Size = UDim2.new(0, 200, 0, 50)
                                    BillboardGui.StudsOffset = Vector3.new(0, 3, 0)
                                    BillboardGui.AlwaysOnTop = true
                                    BillboardGui.Parent = v.Character.Head

                                    local TextLabel = Instance.new("TextLabel")
                                    TextLabel.Size = UDim2.new(1, 0, 1, 0)
                                    TextLabel.BackgroundTransparency = 1
                                    TextLabel.Text = v.Name .. " (躲藏中)"
                                    TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
                                    TextLabel.TextScaled = true
                                    TextLabel.Font = Enum.Font.SourceSansBold
                                    TextLabel.Parent = BillboardGui

                                    local UIStroke = Instance.new("UIStroke")
                                    UIStroke.Color = Color3.new(0, 0, 0)
                                    UIStroke.Thickness = 1.5
                                    UIStroke.Parent = TextLabel
                                end
                            end
                        end
                    end
                end)
                task.wait(1)
            end
        end)
    else
        -- Clean up all player ESP when disabled
        for i, v in pairs(game.Players:GetChildren()) do
            if v ~= lp and v.Character and v.Character:FindFirstChild("Head") then
                for _, z in pairs(v.Character.Head:GetChildren()) do
                    if z.Name:find("Esp_") then
                        z:Destroy()
                    end
                end
            end
        end
    end
end)

-- 传送收集功能
SectionHide2:Button("一键收集全部钥匙", function()
    if lp:GetAttribute("IsHider") and lp.Character and lp.Character:FindFirstChild("HumanoidRootPart") then
        local OldCFrame = lp.Character.HumanoidRootPart.CFrame
        for _, a in pairs(Workspace.Effects:GetChildren()) do
            if a.Name:find("DroppedKey") and a:FindFirstChild("Handle") then
                lp.Character.HumanoidRootPart.CFrame = a.Handle.CFrame
                wait(0.5)
            end
        end
        lp.Character.HumanoidRootPart.CFrame = OldCFrame
        notify("收集完成", "已收集全部钥匙", 3)
    end
end)

SectionHide2:Button("传送到躲藏玩家", function()
    for i, v in pairs(game.Players:GetChildren()) do
        if v ~= lp and v.Character and v.Character:FindFirstChild("Head") and v.Character:FindFirstChild("HumanoidRootPart") and v.Character:FindFirstChild("Humanoid") then
            if v:GetAttribute("IsHider") and v.Character.Humanoid.Health > 0 then
                lp.Character.HumanoidRootPart.CFrame = v.Character.HumanoidRootPart.CFrame
                notify("传送成功", "已传送到 " .. v.Name, 2)
                break
            end
        end
    end
end)

-- ==================== 标签3: 杂项 ====================
local SectionMisc1 = Tab3:section("玩家设置")
local SectionMisc2 = Tab3:section("实用功能")

-- 玩家设置
SectionMisc1:Textbox("移动速度", "speedBox", "16-1000", function(val)
    _G.Speed = tonumber(val) or 50
    if _G.AutoSpeed and lp.Character:FindFirstChild("Humanoid") then
        lp.Character.Humanoid.WalkSpeed = _G.Speed
    end
end)

SectionMisc1:Toggle("开启移速", "enableSpeed", false, function(state)
    _G.AutoSpeed = state
    if state and lp.Character:FindFirstChild("Humanoid") then
        lp.Character.Humanoid.WalkSpeed = _G.Speed or 50
    elseif lp.Character:FindFirstChild("Humanoid") then
        lp.Character.Humanoid.WalkSpeed = 16
    end
end)

SectionMisc1:Toggle("无限跳", "infiniteJump", false, function(state)
    _G.InfiniteJump = state
end)

SectionMisc1:Toggle("锁定高度", "floatHeight", false, function(state)
    _G.Float = state
    if state then
        FloatConnection = RunService.Heartbeat:Connect(function()
            if lp.Character and lp.Character:FindFirstChild("HumanoidRootPart") then
                local rootPart = lp.Character.HumanoidRootPart
                local bodyVelocity = rootPart:FindFirstChild("FloatVelocity")

                if not bodyVelocity then
                    bodyVelocity = Instance.new("BodyVelocity")
                    bodyVelocity.Name = "FloatVelocity"
                    bodyVelocity.MaxForce = Vector3.new(0, math.huge, 0)
                    bodyVelocity.Velocity = Vector3.new(0, 0, 0)
                    bodyVelocity.Parent = rootPart
                end
            end
        end)
        notify("锁定高度已开启", "已开启", 2)
    else
        if FloatConnection then
            FloatConnection:Disconnect()
            FloatConnection = nil
        end
        if lp.Character and lp.Character:FindFirstChild("HumanoidRootPart") then
            local bodyVelocity = lp.Character.HumanoidRootPart:FindFirstChild("FloatVelocity")
            if bodyVelocity then
                bodyVelocity:Destroy()
            end
        end
        notify("锁定高度已关闭", "已关闭", 2)
    end
end)

SectionMisc1:Toggle("穿墙", "noClip", false, function(state)
    _G.NoClip = state
    if state then
        NoClipConnection = RunService.Stepped:Connect(function()
            if lp.Character then
                for _, part in pairs(lp.Character:GetDescendants()) do
                    if part:IsA("BasePart") and part.CanCollide then
                        part.CanCollide = false
                    end
                end
            end
        end)
        notify("穿墙已开启", "可自由穿透", 2)
    else
        if NoClipConnection then
            NoClipConnection:Disconnect()
            NoClipConnection = nil
        end
        if lp.Character then
            for _, part in pairs(lp.Character:GetDescendants()) do
                if part:IsA("BasePart") then
                    part.CanCollide = true
                end
            end
        end
        notify("穿墙已关闭", "穿墙已关闭", 2)
    end
end)

-- 实用功能
SectionMisc2:Toggle("自动跳过对话", "autoSkipDialogue", false, function(state)
    _G.AutoSkip = state
    if state then
        task.spawn(function()
            while _G.AutoSkip do
                pcall(function()
                    ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("DialogueRemote"):FireServer("Skipped")
                    ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("TemporaryReachedBindable"):FireServer()
                end)
                task.wait(0.8)
            end
        end)
    end
end)

SectionMisc2:Toggle("零交互延迟", "noCooldown", false, function(state)
    _G.NoCooldownProximity = state
    if state then
        for i, v in pairs(Workspace:GetDescendants()) do
            if v.ClassName == "ProximityPrompt" then
                v.HoldDuration = 0
            end
        end
        if CooldownProximity then
            CooldownProximity:Disconnect()
        end
        CooldownProximity = Workspace.DescendantAdded:Connect(function(Cooldown)
            if _G.NoCooldownProximity and Cooldown:IsA("ProximityPrompt") then
                Cooldown.HoldDuration = 0
            end
        end)
    else
        if CooldownProximity then
            CooldownProximity:Disconnect()
            CooldownProximity = nil
        end
    end
end)

SectionMisc2:Toggle("性能优化", "antiLag", false, function(state)
    _G.AntiLag = state
    if state then
        local Terrain = Workspace:FindFirstChildOfClass("Terrain")
        if Terrain then
            Terrain.WaterWaveSize = 0
            Terrain.WaterWaveSpeed = 0
            Terrain.WaterReflectance = 0
            Terrain.WaterTransparency = 1
        end
        game.Lighting.GlobalShadows = false
        game.Lighting.FogEnd = 9e9
        game.Lighting.FogStart = 9e9

        task.spawn(function()
            while _G.AntiLag do
                pcall(function()
                    for i, v in pairs(Workspace:FindFirstChild("Effects"):GetChildren()) do
                        PartLagDe(v)
                    end
                end)
                task.wait(1)
            end
        end)
    end
end)

SectionMisc2:Toggle("防被甩飞", "antiFling", false, function(state)
    _G.AntiFling = state
    while _G.AntiFling do
        pcall(function()
            if lp.Character and lp.Character:FindFirstChild("HumanoidRootPart") then
                lp.Character.HumanoidRootPart.Anchored = true
                lp.Character.HumanoidRootPart.AssemblyAngularVelocity = Vector3.new(0, 0, 0)
                lp.Character.HumanoidRootPart.AssemblyLinearVelocity = Vector3.new(0, 0, 0)
                lp.Character.HumanoidRootPart.Anchored = false
            end
        end)
        task.wait(0.1)
    end
end)

-- ==================== 标签4: 小游戏 ====================
local SectionGames = Tab4:section("其他关卡")

SectionGames:Button("一键完成跳绳", function()
    pcall(function()
        if Workspace:FindFirstChild("JumpRope") and Workspace.JumpRope:FindFirstChild("Important") then
            local model = Workspace.JumpRope.Important:FindFirstChild("Model")
            if model and model:FindFirstChild("LEGS") then
                local pos = model.LEGS.Position
                lp.Character.HumanoidRootPart.CFrame = CFrame.new(pos, pos + Vector3.new(0, 0, -1))
                notify("完成", "已通关", 3)
            end
        end
    end)
end)

SectionGames:Button("玻璃桥透视", function()
    pcall(function()
        if Workspace:FindFirstChild("GlassBridge") then
            local GlassHolder = Workspace.GlassBridge:FindFirstChild("GlassHolder")
            if GlassHolder then
                for i, v in pairs(GlassHolder:GetChildren()) do
                    for k, j in pairs(v:GetChildren()) do
                        if j:IsA("Model") and j.PrimaryPart then
                            local isSafe = not j.PrimaryPart:GetAttribute("exploitingisevil")
                            local Color = isSafe and Color3.fromRGB(28, 235, 87) or Color3.fromRGB(248, 87, 87)
                            j.PrimaryPart.Color = Color
                            j.PrimaryPart.Transparency = 0
                            j.PrimaryPart.Material = Enum.Material.Neon
                        end
                    end
                end
                notify("玻璃桥透视", "已开启", 3)
            end
        end
    end)
end)

SectionGames:Button("一键通过玻璃桥", function()
    pcall(function()
        if Workspace:FindFirstChild("GlassBridge") and Workspace.GlassBridge:FindFirstChild("End") and Workspace.GlassBridge.End.PrimaryPart then
            local pos = Workspace.GlassBridge.End.PrimaryPart.Position + Vector3.new(0, 8, 0)
            lp.Character.HumanoidRootPart.CFrame = CFrame.new(pos, pos + Vector3.new(0, 0, -1))
            notify("已通关", "已传送到终点", 3)
        end
    end)
end)

SectionGames:Toggle("自动抱团", "autoMingle", false, function(state)
    _G.AutoMingle = state
    while _G.AutoMingle do
        pcall(function()
            for i, v in ipairs(lp.Character:GetChildren()) do
                if v.Name == "RemoteForQTE" then
                    v:FireServer()
                end
            end
        end)
        task.wait(0.1)
    end
end)

-- 初始通知
Notification:Notify( 
    {Title = "思绪脚本中心-付费版", Description = "所有功能已成功加载"}, 
    {OutlineColor = Color3.fromRGB(0, 150, 255),Time = 5, Type = "image"}, 
    {Image = "http://www.roblox.com/asset/?id=4483345998", ImageColor = Color3.fromRGB(0, 150, 255)}
)